package hn.cch.spring.aop.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

// @Order(value = 1)
@Aspect
public class ExecutionAspect {

    private static final Logger logger = LoggerFactory.getLogger(ExecutionAspect.class);

    @Around(value = "execution(* around(*))")
    public Object around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        logger.debug("before");
        Object proceed = proceedingJoinPoint.proceed();
        logger.debug("after");
        return proceed;
    }

    // @Before(value = "execution(* around(*))")
    // public void before() {
    //     logger.debug("before");
    // }
    //
    // @After(value = "execution(* around(*))")
    // public void after() {
    //     logger.debug("after");
    // }

}
